package com.itheima;


import com.alibaba.excel.EasyExcel;
import com.itheima.entity.Emp;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class WriteDemo {

    public static void main(String[] args) {
        List<Emp> dataList = new ArrayList<>();


        Emp emp = new Emp(1, "孙悟空", 500, "男", "弼马温");
        Emp emp2 = new Emp(2, "猪八戒", 2000, "男", "自古多情空余恨");
        Emp emp3 = new Emp(3, "唐僧", 30, "男", "钢铁直男，不爱女儿国国王");

        dataList.add(emp);
        dataList.add(emp2);
        dataList.add(emp3);

        EasyExcel.write(new File("D:\\111.xls"), Emp.class).sheet(0).doWrite(dataList);
    }
}
